#!/bin/bash

# ----------------------------------------------------------------------
# Filename:   75576-yum-install-remove.sh
# Version:    1.0
# Date:       2013/12/04
# Author:     yuanhui.shi
# Email:      yuanhui.shi@cs2c.com.cn
# Summary:    02系统基本功能-07开发环境-02开发工具-06yum包管理-04通过yum安装和删除rpm包
# Notes:      yum命令
# Copyright:  China Standard Software Co., Ltd.
# History：     
#             Version 1.0, 2013/12/04
#             -   The first one
# ----------------------------------------------------------------------

PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH

source ../../lib/Echo.sh

source ../../lib/XmlParse.sh


function CleanData ()
{
  #umount /mnt/cdrom
  #rm -rf /mnt/cdrom
  #mv /etc/yum.repos.d/ns6-adv-x86_64.repo.bak /etc/yum.repos.d/ns6-adv-x86_64.repo
  #rm -rf /etc/yum.repos.d/ns6.4.repo
  #EchoInfo "75576-yum-install-remove.sh执行完毕"
  EchoInfo "75576-yum-install-remove.sh未执行"
}

trap "CleanData" EXIT INT

#EchoInfo "创建iso方式的yum源"
##创建iso存放目录和挂载目录
#mkdir /mnt/cdrom
#mount -o loop ./data/ns6.4-adv-x64-b10.iso /mnt/cdrom/
#mv /etc/yum.repos.d/ns6-adv-x86_64.repo /etc/yum.repos.d/ns6-adv-x86_64.repo.bak
#cp ./data/ns6.4.repo /etc/yum.repos.d/
#
#[ -n "`yum repolist |grep ns6.4`" ]
#EchoResult "通过yum repolist可以查看到ns6.4yum源"
#
##删除gcc包
#EchoInfo "通过yum remove 命令删除gcc包"
##echo y| yum remove gcc &>/dev/null
#[ -z "`rpm -qa |grep ^gcc-`" ]
#EchoResult "通过yum命令成功删除gcc包"
#
##安装gcc包
#EchoInfo "通过yum install  命令安装gcc包"
##echo y| yum install gcc &>/dev/null
#[ -n "`rpm -qa |grep ^gcc-`" ]
#EchoResult "通过yum命令成功安装gcc包"

exit 1
